package com.xiaofeng.pochi.service;

import com.xiaofeng.pochi.common.Page;
import com.xiaofeng.pochi.pojo.ShopOrder;
import com.xiaofeng.pochi.pojo.ShopOrderHistory;
import com.xiaofeng.pochi.pojo.dto.OrderDto;
import com.xiaofeng.pochi.pojo.vo.OrderMonthVo;
import com.xiaofeng.pochi.pojo.vo.OrderPointVo;
import com.xiaofeng.pochi.pojo.vo.ShopOrderVo;
import com.xiaofeng.pochi.pojo.wx.WxOrderVo;
import com.xiaofeng.pochi.utils.ResultInfo;

import java.io.IOException;
import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/09/17/23:51
 * @Description:
 */
public interface ShopOrderService {

    /**
     * 提交订单
     */
    ShopOrder createOrder(OrderDto orderDto);

    void createPayOrder(ShopOrder order ,String dateTime) throws Exception;

    /**
     * 处理订单支付回调
     * @param reqParams
     */
    void handleOrderNotify(String reqParams) throws IOException;

    /**
     * 分页查询前台用户订单列表
     * @param page
     * @return
     */
    Page<ShopOrderVo> getMyOrder(Page<ShopOrderVo> page);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    ShopOrderVo get(Long id);

    /**
     * 根据id收货
     * @param id
     */
    void receiveById(Long id);

    /**
     * 查询订单历史
     * @param id
     * @return
     */
    List<ShopOrderHistory> getHistory(Long id);

    /**
     * 分页查询
     * */
    Page<ShopOrder> getByPage(Page<ShopOrder> page);

    /**
     * 改变订单状态
     * */
    void changeOrderStatus(ShopOrder order);

    /**
     * 月订单统计
     * @return
     */
    List<OrderMonthVo> monthOrder();

    /**
     * 查询每种订单占比
     * @return
     */
    List<OrderPointVo> orderPoint();

}
